import request from '@/utils/request'

export function coursePage(data, pageNum, pageSize, courseId) {
  return request({
    url: '/coursePage?pageNum=' + pageNum + '&pageSize=' + pageSize + '&courseId=' + courseId,
    method: 'post',
    data
  })
}



export function addCourse(data) {
  return request({
    url: '/addCourse',
    method: 'post',
    data
  })
}

export function showAll(courseId) {
  return request({
    url: '/showAll?courseId='+courseId,
    method: 'post'
  })
}

export function addChapter(data,courseId) {
  return request({
    url: '/addChapter?courseId='+courseId,
    method: 'post',
    data
  })
}

export function addVideo(data) {
  return request({
    url: '/addVideo',
    method: 'post',
    data
  })
}




export function removeCourse(id) {
  return request({
    url: '/removeCourse?id=' + id,
    method: 'post'
  })
}

export function removeChapter(id) {
  return request({
    url: '/removeChapter?id='+id,
    method: 'post'
  })
}

export function removeVideo(id) {
  return request({
    url: '/removeVideo?id='+id,
    method: 'post'
  })
}

export function getPublish(courseId) {
  return request({
    url: '/getPublish?courseId='+courseId,
    method: 'post'
  })
}

export function updateStatus(courseId) {
  return request({
    url: '/updateStatus?courseId='+courseId,
    method: 'post'
  })
}
